//import $cookie from '../../../lib/cookie';
// let warn = null;
export default async (response: any, resolve: any, errorCallBack: any) => {
  if (response.code === '000000') {
    resolve(response)
  } else if (response.code === '002009') {
    // 登陆认证失败
    // if (!warn) {
    localStorage.removeItem('token')
    setTimeout(() => {
      location.href = '/'
    }, 200)
    // }
  } else {
    errorCallBack(response.msg || response.errmsg)
  }
}
